using System;
using System.Runtime.InteropServices;
namespace BMC.ARSystem
{
	[Guid("a1596ada-fa0c-4590-b3ab-6fadac309a00")]
	public class ArchiveInfo
	{
		[ARStructMemTypeInfo(Name = "enable", Offset = 0u)]
		private bool _enable;
		[ARStructMemTypeInfo(Name = "archiveType", Offset = 1u)]
		private uint _archiveType;
		[ARStructMemTypeInfo(Name = "formName", Offset = 2u)]
		private string _formName;
		[ARStructMemTypeInfo(Name = "formName", Offset = 2u)]
		private string _dirPath;
		[ARStructMemTypeInfo(Name = "archiveTime", Offset = 3u)]
		private EscalationTime _archiveTime;
		[ARStructMemTypeInfo(Name = "query", Offset = 4u)]
		private string _query;
		[ARStructMemTypeInfo(Name = "archiveFrom", Offset = 5u)]
		private string _archiveFrom;
		public bool Enable
		{
			get
			{
				return this._enable;
			}
			set
			{
				this._enable = value;
			}
		}
		public uint ArchiveType
		{
			get
			{
				return this._archiveType;
			}
			set
			{
				this._archiveType = value;
			}
		}
		public string FormName
		{
			get
			{
				return this._formName;
			}
			set
			{
				this._formName = value;
			}
		}
		public string DirectoryPath
		{
			get
			{
				return this._dirPath;
			}
			set
			{
				this._dirPath = value;
			}
		}
		public EscalationTime ArchiveTime
		{
			get
			{
				return this._archiveTime;
			}
			set
			{
				this._archiveTime = value;
			}
		}
		public string Query
		{
			get
			{
				return this._query;
			}
			set
			{
				this._query = value;
			}
		}
		public string ArchiveFrom
		{
			get
			{
				return this._archiveFrom;
			}
			set
			{
				this._archiveFrom = value;
			}
		}
		public ArchiveInfo()
		{
		}
		internal ArchiveInfo(object[] rawData, Server server)
		{
			int[] indexSpec = new int[1];
			this.Enable = (Convert.ToInt32(Util.GetAt(rawData, indexSpec)) != 0);
			this.ArchiveType = Convert.ToUInt32(Util.GetAt(rawData, new int[]
			{
				1
			}));
			this.FormName = (this.DirectoryPath = "");
			if ((this.ArchiveType & 1u) != 0u || (this.ArchiveType & 4u) != 0u || (this.ArchiveType & 8u) != 0u)
			{
				this.FormName = (string)Util.GetAt(rawData, new int[]
				{
					2
				});
			}
			else
			{
				this.DirectoryPath = (string)Util.GetAt(rawData, new int[]
				{
					2
				});
			}
			this.ArchiveTime = new EscalationTime((object[])Util.GetAt(rawData, new int[]
			{
				3
			}), server);
			this.Query = server.FormatQualification(server.Session.CurrentLocalForm, Util.GetAt(rawData, new int[]
			{
				4
			}));
			this.ArchiveFrom = (string)Util.GetAt(rawData, new int[]
			{
				5
			});
		}
		internal static ArchiveInfo createInstance(object[] rawData, Server server)
		{
			return new ArchiveInfo(rawData, server);
		}
		internal static object ToVariant(object given, Server server)
		{
			ArchiveInfo archiveInfo = given as ArchiveInfo;
			if (archiveInfo == null)
			{
				return given;
			}
			object[] array = new object[7];
			array[0] = (archiveInfo.Enable ? 1 : 0);
			array[1] = ARTypeMgr.Instance.toVariant(archiveInfo.ArchiveType);
			if ((archiveInfo.ArchiveType & 1u) != 0u || (archiveInfo.ArchiveType & 4u) != 0u || (archiveInfo.ArchiveType & 8u) != 0u)
			{
				array[2] = ARTypeMgr.Instance.toVariant(archiveInfo.FormName);
			}
			else
			{
				array[2] = ARTypeMgr.Instance.toVariant(archiveInfo.DirectoryPath);
			}
			array[3] = ((object[])ARTypeMgr.Instance.toVariant(archiveInfo.ArchiveTime))[1];
			array[4] = server.ParseQualification(server.Session.CurrentLocalForm, archiveInfo.Query);
			array[5] = ARTypeMgr.Instance.toVariant(archiveInfo.ArchiveFrom);
			return array;
		}
	}
}
